package top.dreamcenter.ai.mcp.tool;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Component;

@Component
public class DemoTool {


    @Tool(name = "getWeather", description = "获取指定城市的温度")
    public String getWeather(@ToolParam(description = "城市名称") String city) {
        return city + "的温度是:" + city.length();
    }

    @Tool(name = "isMagicNum", description = "判断一个数字是否是魔法数")
    public String isMagicNum(@ToolParam(description = "待判定的数字") Integer num) {
        return num + (((num%3 == 0) &&(num%7 == 0)) ? "是魔法数" : "不是魔法数");
    }

}
